Skip to content

HDDS-15657. excludeContainersDueToFailure resets every iteration, repeatedly failing containers keep being retried - #10892

Open
sravani-revuri wants to merge 3 commits into
apache:masterfrom
sravani-revuri:HDDS-15657
Open

HDDS-15657. excludeContainersDueToFailure resets every iteration, repeatedly failing containers keep being retried#10892
sravani-revuri wants to merge 3 commits into
apache:masterfrom
sravani-revuri:HDDS-15657

Conversation

@sravani-revuri

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

selectionCriteria is re-created fresh every iteration.

selectionCriteria = new ContainerBalancerSelectionCriteria(config,cnodeManager, replicationManager, containerManager, findSourceStrategy, containerToSourceMap); 

If container C failed (ContainerNotFoundException or any other error) in iteration 1 and was added to excludeContainersDueToFailure, it will be tried again in iteration 2 with the same result. This wastes time on permanently broken containers.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15657

How was this patch tested?

Written unit test.

…eatedly failing containers keep being retried
@sravani-revuri
sravani-revuri marked this pull request as ready for review July 29, 2026 07:13

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! @sravani-revuri this makes sense for the ContainerNotFoundException cases, which are the permanently broken containers from the Jira but the other two call sites look transient. Could we confirm that every failure stored here is permanent?

@sreejasahithi sreejasahithi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sravani-revuri for working on this.
Agree that we should only persist ContainerNotFoundException across iterations and not the temp or transient failures.

@ashishkumar50 ashishkumar50 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sravani-revuri Thanks for the update, please find few nits.

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reworking! I left two inline comments about one missing production path and its test coverage. Otherwise, the changes look good to me. 🙂



@Test
public void testExcludeContainersNotFoundPersistsAcrossIterations() throws Exception {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test may pass before the fix because a missing container already cannot reach moveManager.move() again. Could we also verify that iteration 2 does not call getContainer(notFoundId) again? This would directly test the persistent exclusion behavior.

// exclude the container which caused failure of move to avoid error in next run.
selectionCriteria.addToExcludeDueToFailContainers(moveSelection.getContainerID());
// exclude the permanently missing container across balancer iterations.
selectionCriteria.addToExcludeNotFoundContainers(moveSelection.getContainerID());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I noticed thatincSizeSelectedForMoving() (around line 1200) is the one remaining ContainerNotFoundException site that does not record the container. So a container that first goes missing there is probed once more before entering the persistent set.

Should we add it to excludeContainersNotFound there so the next iteration does not probe it again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants